﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="RegisterAccount.aspx.cs" Inherits="Pages_RegisterAccount" %>

<%@ MasterType VirtualPath="~/Site.Master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="pnRegister" runat="server" ForeColor="red">
                Chú ý: Các ô có dấu (*) là những ô bắt buộc phải điền thông tin.
                <br />
                <br />
                <asp:Panel ID="pnError" runat="server" ForeColor="red" Visible="false">
                    <table border="0" cellpadding="3" cellspacing="3" width="100%">
                        <tr>
                            <td colspan="2" style="background-color: #EEE; color: red;">
                                Lỗi xảy ra.
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lberror" runat="server" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <table border="0" cellpadding="3" cellspacing="3" width="100%">
                    <tr>
                        <td colspan="2" style="background-color: #EEE; color: Blue;">
                            Thông tin dùng để đăng nhập website.
                        </td>
                    </tr>
                    <tr>
                        <td style="color: Black">
                            Tài khoản(TK):
                        </td>
                        <td>
                            <asp:TextBox ID="txtUserName" runat="server" Width="200px" ForeColor="Blue"></asp:TextBox>
                            <%--<asp:Button ID="btcheck" Text="&nbsp;Kiểm tra&nbsp;" runat="server" Width="60px"
                                Height="20px" OnClick="btcheck_Click" />--%>
                            (*)<asp:ImageButton ID="ibtcheckaccount" runat="server" ImageUrl="~/Styles/Images/refresh.png"
                                OnClick="ibtcheckaccount_Click" ToolTip='Kiểm tra tồn tại' />
                            <asp:Label ID="lbcheckexist" runat="server" Visible="false"></asp:Label>
                            <asp:RegularExpressionValidator runat="server" ID="revUserName" ControlToValidate="txtUserName"
                                Display="Dynamic" ErrorMessage="TK không hợp lệ!" ValidationExpression="^([a-z0-9_\.\s]{3,16})$"
                                ForeColor="Red">
                            </asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="color: Black">
                            Mật khẩu:
                        </td>
                        <td>
                            <asp:TextBox ID="txtPassword1" TextMode="Password" Width="200px" runat="server" />
                            (*)
                            <asp:RegularExpressionValidator runat="server" ID="revPassword" ControlToValidate="txtPassword1"
                                Display="Dynamic" ErrorMessage="Mật khẩu không hợp lệ!" ValidationExpression="^([a-z0-9_\s\$\#@\!\*]{3,16})$"
                                ForeColor="Red">
                            </asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="color: Black">
                            Nhập lại mật khẩu:
                        </td>
                        <td>
                            <asp:TextBox ID="txtPassword2" TextMode="Password" Width="200px" runat="server" />
                            (*)
                            <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="txtPassword1"
                                ControlToValidate="txtPassword2" ErrorMessage="Mật khẩu không khớp" ForeColor="Red"></asp:CompareValidator>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="background-color: #EEE; color: Blue;">
                            Thông tin cá nhân.
                        </td>
                    </tr>
                    <tr>
                        <td style="color: Black">
                            Facbook Id:
                        </td>
                        <td>
                            <asp:TextBox ID="txtFB_Id" Width="200px" runat="server" Enabled="false" />
                        </td>
                    </tr>
                    <tr>
                        <td style="color: Black">
                            Họ tên:
                        </td>
                        <td>
                            <asp:TextBox ID="txtFullName" Width="200px" runat="server" />
                            (*)
                        </td>
                    </tr>
                    <tr>
                        <td style="color: Black">
                            Địa chỉ:
                        </td>
                        <td>
                            <asp:TextBox ID="txtAddress" TextMode="MultiLine" Width="200px" runat="server" />
                            <span>(*)</span>
                        </td>
                    </tr>
                    <tr>
                        <td style="color: Black">
                            Điện thoại:
                        </td>
                        <td>
                            <asp:TextBox ID="txtPhone" runat="server" Width="200px" onkeypress="return onlyNumbers();"></asp:TextBox>
                            (*)
                            <asp:RegularExpressionValidator runat="server" ID="valNumbersOnly" ControlToValidate="txtPhone"
                                Display="Dynamic" ErrorMessage="Chỉ được nhập số" ValidationExpression="(^([0-9]*|\d*\d{1}?\d*)$)"
                                ForeColor="Red">
                            </asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="color: Black">
                            Email:
                        </td>
                        <td>
                            <asp:TextBox ID="txtMail" Width="200px" runat="server" />
                            (*)
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtMail"
                                ErrorMessage="Không đúng định dạng Email" ForeColor="Red" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="color: Black;">
                            Mã bảo vệ:
                        </td>
                        <td>
                            <asp:TextBox ID="txtCaptcha" Width="200px" runat="server" />
                            (*)
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <div id="Div1" style="margin-left: 40px;" runat="server">
                                <asp:Image ID="captchaImage" runat="server" />
                                <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/Styles/Images/refresh.png"
                                    OnClick="ImageButton1_Click" ToolTip="Đổi mã bảo vệ" />
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <asp:Button ID="btnRegister" Text="&nbsp;Đăng ký&nbsp;" runat="server" OnClick="btnRegister_Click"
                                Height="25px" class="fb_invite_button"/>
                            <%--<asp:Button ID="btrefresh" Text="&nbsp;Làm mới&nbsp;" runat="server" Height="25px"
                        OnClick="btrefresh_Click" />--%>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="pnRegisterSuccessfull" runat="server" ForeColor="blue">
                Đăng ký tài khoản thành công. Bây giờ bạn có thể đăng nhập với tài khoản của mình.
            </asp:Panel>
            <asp:Panel ID="pnExistAccount" runat="server" ForeColor="blue" Visible="false">
                Tài khoản Facebook này đã đăng ký gian hàng. Tên đăng nhập:
                <asp:Label ID="lbUsernameExist" runat="server" ForeColor="Red"></asp:Label>
                <asp:LinkButton ID="lbtforgotpass" runat="server" 
                    onclick="lbtforgotpass_Click" >Quên mật khẩu?</asp:LinkButton>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="footer" runat="Server">
</asp:Content>
